<?php
/**
 * @version		$Id: categories.php 18695 2010-08-28 17:18:48Z infograf768 $
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die;

jimport('joomla.application.component.modelitem');

/**
 * This models supports retrieving lists of article categories.
 *
 * @package		Joomla.Administrator
 * @subpackage	com_content
 * @since		1.6
 */
class skknModelDetail extends JModelItem
{
	/**
	 * Model context string.
	 *
	 * @var		string
	 */
	public $_context = 'com_skkn.detail';
	
	function getItem()
	{
		$db =& JFactory::getDbo();
		$id = JRequest::getVar('id');
		
		$query  = " SELECT a.*, c.title as category_title, org.name AS org_title, type.name as type_title, kind.name AS working_kind_title ";
		$query .= " FROM #__skkn a ";
		$query .= " LEFT JOIN #__categories c ON a.catid = c.id ";
		$query .= " LEFT JOIN #__skkn_info org ON a.org_id = org.id ";
		$query .= " LEFT JOIN #__skkn_info type ON a.type_id = type.id ";
		$query .= " LEFT JOIN #__skkn_info kind ON a.working_kind_id = kind.id ";
		
		$query .= " WHERE a.id = '$id' AND a.state = 1";
		$db->setQuery($query);
		
		return $db->loadObject();
	}
}